package com.shengyin.ec.model.dao.alliance;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.shengyin.ec.model.dao.BaseDaoImpl;
import com.shengyin.ec.model.entity.ProjectDemandInfo;

@Repository("projectDemandInfo")
public class ProjectDemandInfoDaoImpl extends BaseDaoImpl<ProjectDemandInfo> implements ProjectDemandInfoDao {
	
	public List<ProjectDemandInfo> getProjectDemandInfoListByCompanyId(long companyId){
		List<ProjectDemandInfo> pdiList =  super.find("from ProjectDemandInfo where projectDemandCompanyId='"+companyId+"'");
		
		return pdiList;
	}
	
	public void createProject(ProjectDemandInfo project){
		super.save(project);
	}
	
	public List<ProjectDemandInfo> getProjectDemandInfoListByBeginTime(long companyId){
		List<ProjectDemandInfo> pdiList =  super.find("from ProjectDemandInfo where projectDemandCompanyId='"+companyId+"' order by projectDemandTime");
		
		return pdiList;
	}
	
	public List<ProjectDemandInfo> getProjectDemandInfoListByCreateTime(long companyId){
		List<ProjectDemandInfo> pdiList =  super.find("from ProjectDemandInfo where projectDemandCompanyId='"+companyId+"' order by createTime");
		
		return pdiList;
	}
	
	public List<ProjectDemandInfo> getAllProjectDemandInfoList(){
		List<ProjectDemandInfo> pdiList =  super.find("from ProjectDemandInfo");
		
		return pdiList;
	}
	
	public List<ProjectDemandInfo> getAllProjectDemandInfoListByBeginTime(){
		List<ProjectDemandInfo> pdiList =  super.find("from ProjectDemandInfo order by projectDemandTime");
		
		return pdiList;
	}
	
	public List<ProjectDemandInfo> getAllProjectDemandInfoListByCreateTime(){
		List<ProjectDemandInfo> pdiList =  super.find("from ProjectDemandInfo order by createTime");
	
		return pdiList;
	}
}